<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:74:"/opt/lampp/htdocs/zfshpt_5/public/../application/front/view/v2/index2.html";i:1525256978;}*/ ?>
<!doctype html>
<html>
<head>
<meta name="format-detection"  content="telephone=no">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">
<meta  http-equiv="x-rim-auto-match" content="none">
<meta charset="UTF-8">
<meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0;" name="viewport;">
<meta content="user-scalable=no" name="viewport">
<title>至富通</title>
<script src="http://__JS__/jquery.js"></script>
<script src="http://__JS__/jquery-1.8.3.min.js"></script>   
<script src="http://__THEMES__/js/aui.js"></script>  
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>   
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.4&key=013942c74f234d17b73396781444748a"></script>                              
<link href="http://__CSS__/my-style.css" rel="stylesheet" type="text/css">
<link rel="icon" href="http://__IMG__/favicon.ico">
<script type="text/javascript">
function checkName() {
	var result=false;
    $.ajax({
        type : "post",
        url : "__URL__ShowController/checkStorename",
        data : $("#gover_search_key").serialize(),
        cache : false,
        async : false,
        dataType : "json",
        success : function(data) {
        	if(data=="true"){
        		 result=true;	
        	}else{
        		alert("店铺："+data+" 不存在，请输入完整店铺名！");
        	}
        	
        },
        error : function(data) {
            alert("请重新输入店铺名！"+data);
        }
    });
    return result;
}
</script>
</head>
<style>
.guidong{}
#diva{display:black;width:400px;height:50px;line-height:50px;white-space:nowrap;overflow:hidden;margin:15px;padding:5px 15px;}
.guidong span{display:inline-block;padding-right:20px;}
</style>
<body style="background:#FFF;">
<!--首页，钱包-->
<header class="b-logo">
<!--<div class="dbdh">
 <div style="width:50%; height:105px; margin-top:14px; float:left;">
  <a href="showStore"><div style="margin-left:45%">
   <img src="http://__IMG__/shouye.png" width="60">
    <p class="dbdh-wz1">首页</p>
  </div></a>
 </div>
  <div style="width:50%; height:105px; margin-top:10px; float:left;">
   <a href="__URL__ShowController/PersonalCenter"><div style="margin-left:45%">
   <img src="http://__IMG__/qianbao.png" width="65">
    <p class="dbdh-wz2">钱包</p>
  </div></a>
  </div>-->
</div>
<div class="" style="margin-top:20px; float:left;">
</div>
<!--搜索框-->
<div class="gover_search">
 <div class="gover_search_form clearfix"> 
 <form action="__URL__ShowController/QueryZhiFu">
 <span class="search_t"></span>
 <input  type="text" name="store_name" class="input_search_key" id="gover_search_key" placeholder="输入店铺名可直接搜索"/>
 <button type="submit"  class="search_btn" onclick="return checkName();">搜索</button>
 <div class="search_suggest" id="gov_search_suggest">
  <ul>
  </ul>
 </div>
 </form>
 </div>
</div>
</header>
<style>
/*行业文字动画*/
.hywzdh{position:absolute; top:380px; right:10px; font-weight:700; font-size:60px; animation:myfirst 13s; -webkit-animation:myfirst 13s; /* Safari and Chrome */}
@keyframes myfirst
{
	0%   {color:black; font-weight:700; top:100px; right:10px;}
	25%  {color:#60aef6; font-weight:700; top:100px; right:850px;}
	50%  {color:#fcb12e; font-weight:700; top:100px; right:10px;}
	100% {color:black; font-weight:700; top:380px; right:10px;}
}
@-webkit-keyframes myfirst
{
	0%   {color:black; font-weight:700; top:100px; right:10px;}
	25%  {color:#60aef6; font-weight:700; top:100px; right:850px}
	50%  {color:#fcb12e; font-weight:700; top:100px; right:10px;}
	100% {color:black; font-weight:700; top:380px; right:10px;}
}
</style>
<!--轮播图-->
  <img src="http://__THEMES__/<?php echo $sign; ?>" width="100%" style="position:relative;">
       <div style="margin-top:35px;">
         <?php if(is_array($themelist) || $themelist instanceof \think\Collection || $themelist instanceof \think\Paginator): $i = 0;$__LIST__ = is_array($themelist) ? array_slice($themelist,0,1, true) : $themelist->slice(0,1, true); if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$tl): $mod = ($i % 2 );++$i;?>
        <a href="__URL__ShowController/showStoreForTrade?trade_id=<?php echo $tl['id']; ?>">
        <div class="hytb1"><img src="http://__THEMES__/<?php echo $tl['themes_imgurl']; ?>"><p> <?php echo $tl['trade_name']; ?></p></div></a>
          <?php endforeach; endif; else: echo "" ;endif; if(is_array($themelist) || $themelist instanceof \think\Collection || $themelist instanceof \think\Paginator): $i = 0;$__LIST__ = is_array($themelist) ? array_slice($themelist,1,4, true) : $themelist->slice(1,4, true); if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$tl): $mod = ($i % 2 );++$i;?>
        <a href="__URL__ShowController/showStoreForTrade?trade_id=<?php echo $tl['id']; ?>"><div class="hytb-all"><img src="http://__THEMES__/<?php echo $tl['themes_imgurl']; ?>"><p> <?php echo $tl['trade_name']; ?></p></div></a>
          <?php endforeach; endif; else: echo "" ;endif; ?>
          </div>
           <div style="margin-top:87px; float:left;">
         <?php if(is_array($themelist) || $themelist instanceof \think\Collection || $themelist instanceof \think\Paginator): $i = 0;$__LIST__ = is_array($themelist) ? array_slice($themelist,5,1, true) : $themelist->slice(5,1, true); if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$tl): $mod = ($i % 2 );++$i;?>
        <a href="__URL__ShowController/showStoreForTrade?trade_id=<?php echo $tl['id']; ?>"><div class="hytb1"><img src="http://__THEMES__/<?php echo $tl['themes_imgurl']; ?>"><p> <?php echo $tl['trade_name']; ?></p></div></a>
          <?php endforeach; endif; else: echo "" ;endif; if(is_array($themelist) || $themelist instanceof \think\Collection || $themelist instanceof \think\Paginator): $i = 0;$__LIST__ = is_array($themelist) ? array_slice($themelist,6,4, true) : $themelist->slice(6,4, true); if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$tl): $mod = ($i % 2 );++$i;?>
        <a href="__URL__ShowController/showStoreForTrade?trade_id=<?php echo $tl['id']; ?>"><div class="hytb-all"><img src="http://__THEMES__/<?php echo $tl['themes_imgurl']; ?>"><p> <?php echo $tl['trade_name']; ?></p></div></a>
          <?php endforeach; endif; else: echo "" ;endif; ?>
          </div>
<!--行业筛选
<div style="margin-top:35px;">
 <a href=""><div class="hytb1"><img src="../../../themes/img/classification/canying.png"><p>餐饮</p></div></a>
  <a href=""><div class="hytb-all"><img src="../../../themes/img/classification/meifa.png"><p>美容美发</p></div></a>
   <a href=""><div class="hytb-all"><img src="../../../themes/img/classification/yule.png"><p>休闲娱乐</p></div></a>
    <a href=""><div class="hytb-all"><img src="../../../themes/img/classification/gouwu.png"><p>时尚购物</p></div></a>
     <a href=""><div class="hytb-all"><img src="../../../themes/img/classification/yanjiu.png"><p>食品烟酒</p></div></a>
</div>
<div style="margin-top:55px; float:left;">
 <a href=""><div class="hytb1"><img src="../../../themes/img/classification/muying.png"><p>母婴亲子</p></div></a>
  <a href=""><div class="hytb-all"><img src="../../../themes/img/classification/qiche.png"><p>汽车服务</p></div></a>
   <a href=""><div class="hytb-all"><img src="../../../themes/img/classification/fuwu.png"><p>生活服务</p></div></a>
    <a href=""><div class="hytb-all"><img src="../../../themes/img/classification/all2.png"><p>全部行业</p></div></a>
     <a href=""><div class="hytb-all"><img src="../../../themes/img/classification/all1.png"><p>全部行业</p></div></a>
</div>-->
<!--行业筛选-->
<!--灰边-->
<div class="huihui" style="margin-top:45px; margin-bottom:10px; float:left;"></div>
<!--灰边-->
<!--为你推荐-->
<div class="hbk"> 
  <div class="hbk-wz">
   <img src="http://__IMG__/love.png" style="vertical-align:middle;">
    <span style="color:black; font-family:'微软雅黑'; vertical-align:middle; font-size:42px; font-weight:600;">为你推荐</span>
  </div>
   <div class="hxhx"></div>
</div>
<!--为你推荐-->
 <span id="xy"></span>
<div class="ggzs">
 <div class="ggzschi">
  <div class="biaoqian1">吃的开心</div>
   <div class="ggwzwz1">广告招商<br><span style=" margin-left:18px;">虚位以待</span></div>
    <div class="hywzwz1">小吃快餐</div>
     <div><img src="http://__IMG__/chwl1.jpg" width="290" style="margin:10px 0 0 100px; border-radius:50%;"></div>
 </div>
  <div class="ggzshe">
   <div class="biaoqian2">唱的痛快</div>
    <div class="ggwzwz2">广告招商<span style=" margin-left:9px;">虚位以待</span></div>
     <div class="hywzwz2">KTV</div>
      <div><img src="http://__IMG__/chwl2.jpg" width="300" style="border-radius:50%; position:absolute; top:80px; right:-20px;"></div>
  </div>
   <div class="ggzswan">
    <div class="biaoqian3">住的安逸</div>
     <div class="ggwzwz3">等你加入</div>
      <div class="hywzwz3">酒店宾馆</div>
      <div><img src="http://__IMG__/chwl3.jpg" width="150" style="border-radius:50%; position:absolute; top:180px; right:-10px;"></div>
   </div>
    <div class="ggzsle">
     <div class="biaoqian4">玩的新颖</div>
      <div class="ggwzwz4">等你加入</div>
       <div class="hywzwz4">休闲度假</div>
        <div><img src="http://__IMG__/chwl4.jpg" width="150" style="border-radius:50%; position:absolute; top:180px; right:-10px;"></div>
    </div>
</div>
<!--活动宣传-->
<a href="Member ID.html"><img src="http://__IMG__/zftxf.jpg" style=" width:100%; margin:10px 0 3px;"></a>
<!--活动宣传-->
<!--灰边-->
<div class="huihui" style="margin-bottom:10px;"></div>
<!--灰边-->
<!--附近店铺-->
  <div class="hbk">
   <div class="hbk-wz">
   <img src="http://__IMG__/fangzi.png" style="vertical-align:middle;">
    <span style="color:black; font-family:'微软雅黑'; vertical-align:middle; font-size:42px; font-weight:600;">附近店铺</span>
  </div>
   <div class="hxhx"></div>
  </div>
<!--附近店铺-->
  
  <!--商家卡片--> 	
 <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
      <a href="<?php echo url('Home/Index/zhifw'); ?>?id=<?php echo $v['id']; ?>"> 
  <div class="baika" id="<?php echo $v['id']; ?>">
   <div class="baika2">
    <div class="tubaika">
     <img src="http://sunhongliang.top.1048.url-test.com/zfshlm/public/upload/<?php echo $v['imgurl']; ?>" >
    </div>
     <div class="xxbaika">
      <h1><?php echo $v['store_name']; ?>&nbsp;&nbsp;&nbsp;&nbsp;</h1> 
       <h2><img src="http://__IMG__/star.png" width="250"><span><p class="yangshi1">抢购</p></span></h2>
        <h3 style=" width:600px; height:45px; overflow:hidden;"><span><img src="http://__IMG__/location.png" width="35"></span><?php echo $v['address']; ?></h3>
         <h4 style=" width:575px; height:45px; overflow:hidden;"><span><img src="http://__IMG__/dianhua.png" width="35" style="margin-right:3px; margin-bottom:-2px;"></span>
               <a href="tel:<?php echo $v['phone']; ?>"><?php echo $v['phone']; ?></a><p class="yangshi2"><span id="p<?php echo $v['id']; ?>"></span></p>
         </h4>  
     </div>
   </div>
  </div>
	       <div class="huihui"></div>     
	      </a>  
	      <?php endforeach; endif; else: echo "" ;endif; ?>   
	       <script>
	        mapObj = new AMap.Map('');
	        mapObj.plugin('AMap.Geolocation', function () {
	            geolocation = new AMap.Geolocation();
	            mapObj.addControl(geolocation);
	            geolocation.getCurrentPosition();
	            AMap.event.addListener(geolocation, 'complete', onComplete);//返回定位信息
	            AMap.event.addListener(geolocation, 'error', onError);      //返回定位出错信息
	        });
	      //解析定位结果
	        function onComplete(data) {
				var xy = data.position.lng+","+data.position.lat;
				$("#xy").html(xy); 
				$("#xy").css('display','none'); 
	        	<?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
	 	        var distance1 = data.position.distance([<?php echo $v['position']; ?>]);
	        	if(distance1>=1000){
	        		distance = (distance1/1000).toFixed(2)+"km";
	        	}else{
	        		distance = distance1.toFixed(2)+"m";
	        	}
	            $("#p<?php echo $v['id']; ?>").html(distance); 
	            if(distance1>30000){
	            	$("#"+<?php echo $v['id']; ?>).css('display','none');
	            	$("#"+<?php echo $v['id']; ?>).next().css('display','none');
	            }
	 	        <?php endforeach; endif; else: echo "" ;endif; ?>
	        }
	        </script>
	        <script>
//实时监听浏览器滚动条状态（页面必须要有滚动状态）
  var topValue = 0,// 上次滚动条到顶部的距离
      interval = null;// 定时器
  document.onscroll = function(){ //onscroll监听滚动条元素 每隔500毫秒执行一次
      if(interval == null)// 未发起时，启动定时器，0.5秒1执行
      if(<?php echo $lock; ?>==0){
    	  interval = setInterval("execute()", 200); 
          topValue = document.documentElement.scrollTop;
      }
         
  }
              var ac = 0;      //标记下次从第几个元素开始 的index
  function execute() {
      // 判断此刻到顶部的距离是否和1秒前的距离相等
      //if(document.documentElement.scrollTop == topValue) {
      if(checkscrollside()) {           
              clearInterval(interval);
              interval = null;
              var xmlhttp;
          	if (window.XMLHttpRequest)
          	{
          		// IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
          		xmlhttp=new XMLHttpRequest();
          	}
          	else
          	{
          		// IE6, IE5 浏览器执行代码
          		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
          	}
          	xmlhttp.onreadystatechange=function()
          	{
          		if (xmlhttp.readyState==4 && xmlhttp.status==200)
          		{

          			dataload(xmlhttp.responseText);
          			//document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
          		}
          	}
          	ac = ac+2;
          	xmlhttp.open("GET","http://www.zfshlm.com/155e7ac5857fb33bb5d9430ef3be1699/thinkphp32_zfshlm/index.php/Home/Index/ajax?ac="+ac,true);
          	xmlhttp.send();   
             // dataload();
      }
  }
	
  /*
  	检查是否加载数据
  */
  function checkscrollside(){
      var $aPin = $(".baika");//$( "#main>div" );
      var lastPinH = $aPin.last().get(0).offsetTop + Math.floor($aPin.last().height()/2);//触发条件
      //var scrollTop = $( window ).scrollTop()//注意解决兼容性
      var scrollTop = document.documentElement.scrollTop;
      //var documentH = $( document ).height();//页面高度  //注意解决兼容性 
      var documentH = document.body.scrollHeight;//页面高度 
      return (lastPinH < scrollTop + documentH ) ? true : false;
  }
  
  var date; //接受ajax方法渲染的数据 echo json_encode($list);
  /*
   数据加载
  */
  
  function dataload(data){
	  var ar = $("#xy").html().split(",");
	  var lnglat = new AMap.LngLat(ar[0],ar[1]);
	  date=eval("("+data+")");
	  for (var i=0;i<2;i++){
		  	var one = $('<div>').addClass('baika').attr('id',date[i].id).appendTo('body');
		    var two = $('<div>').addClass('baika2').appendTo(one);
		    var two2 = $('<div>').addClass('tubaika').appendTo(two);
		    $('<img>').attr('src','http://sunhongliang.top.1048.url-test.com/zfshlm/public/upload/'+date[i].imgurl).appendTo(two2);
		    var a = $('<a>').appendTo(two);
		    a.attr('href','http://www.zfshlm.com/155e7ac5857fb33bb5d9430ef3be1699/thinkphp32_zfshlm/index.php/Home/Index/zhifw?id='+date[i].id); 
		    //a.html(three);
		    var three = $('<div>').addClass('xxbaika').appendTo(a);
			arr= date[i].position.split(",");
			var distanceiner1 = lnglat.distance([arr[0],arr[1]]);
			if(distanceiner1>=1000){
		  		distanceiner = (distanceiner1/1000).toFixed(2)+"km";
		  	}else{
		  		distanceiner = distanceiner1.toFixed(2)+"m";
		  	}
			$(three).append('<h1>'+date[i].store_name+'</h1>');
		    $(three).append('<h2><img src="../../../img/star.png" width="250"><span><p class="yangshi1">抢购</p></span></h2>');
		    //$(three).append('<h3><span><p class="yangshi1">抢购</p></span></h3>');
		    $(three).append('<h3 style=" width:600px; height:45px; overflow:hidden;"><span><img src="../../../img/location.png" width="35"></span>'+date[i].address+'</h3>');
		    $(three).append('<h4><span><img src="../../../img/dianhua.png" width="35" style="margin-right:3px; margin-bottom:-2px;"></span><a href="tel:'+date[i].phone+'">'+date[i].phone+'</a><p class="yangshi2"><span>'+distanceiner+'</span></p></h4> ');
		    $('<div>').addClass('huihui').appendTo('body');
		    if(distanceiner1>30000){$("#"+date[i].id).css('display','none');$("#"+date[i].id).next().css('display','none');}
	  }
  }
  
  
  </script>
  <!-- </foreach> -->
  		<script type="text/javascript">
				history.pushState(null, null, location.href);
				window.addEventListener('popstate', function(event) {
    			history.pushState(null, null, location.href );
    			//此处加入回退时你要执行的代码
   				 wx.closeWindow();
				}); 
		</script>

<!--智能搜索框
<script type="text/javascript" src="http://www.softwhy.com/mytest/jQuery/jquery-1.8.3.js"></script>-->
<script type="text/javascript"> 

function oSearchSuggest(searchFuc)
{ 
 var input = $('#gover_search_key'); 
 var suggestWrap = $('#gov_search_suggest'); 
 var key = ""; 
 var init = function(){ 
 input.bind('keyup',sendKeyWord); 
 input.bind('blur',function(){setTimeout(hideSuggest,100);}) 
 } 
 var hideSuggest = function(){ 
 suggestWrap.hide(); 
 } 
 //发送请求，根据关键字到后台查询 
 var sendKeyWord = function(event){ 
 //键盘选择下拉项 
 if(suggestWrap.css('display')=='block'&&event.keyCode == 38||event.keyCode == 40)
 { 
  var current = suggestWrap.find('li.hover'); 
  if(event.keyCode == 38)
  { 
  if(current.length>0)
  { 
   var prevLi = current.removeClass('hover').prev(); 
   if(prevLi.length>0)
   { 
   prevLi.addClass('hover'); 
   input.val(prevLi.html()); 
   } 
  }
  else
  { 
   var last = suggestWrap.find('li:last'); 
   last.addClass('hover'); 
   input.val(last.html()); 
  } 
  }
  else if(event.keyCode == 40)
  { 
  if(current.length>0)
  { 
   var nextLi = current.removeClass('hover').next(); 
   if(nextLi.length>0)
   { 
   nextLi.addClass('hover'); 
   input.val(nextLi.html()); 
   } 
  }
  else
  { 
   var first = suggestWrap.find('li:first'); 
   first.addClass('hover'); 
   input.val(first.html()); 
  } 
  } 
  //输入字符 
 }
 else
 { 
  var valText = $.trim(input.val()); 
  if(valText ==''||valText==key)
  { 
  return; 
  } 
  searchFuc(valText); 
  key = valText; 
 } 
 } 
 //请求返回后，执行数据展示 
 this.dataDisplay = function(data){ 
 if(data.length<=0)
 { 
  suggestWrap.hide(); 
  return; 
 } 
 //往搜索框下拉建议显示栏中添加条目并显示 
 var li; 
 var tmpFrag = document.createDocumentFragment(); 
 suggestWrap.find('ul').html(''); 
 for(var i=0; i<data.length; i++)
 { 
  li = document.createElement('LI'); 
  li.innerHTML = data[i]; 
  tmpFrag.appendChild(li); 
 } 
 suggestWrap.find('ul').append(tmpFrag); 
 suggestWrap.show(); 
 //为下拉选项绑定鼠标事件 
 suggestWrap.find('li').hover(function(){ 
  suggestWrap.find('li').removeClass('hover'); 
  $(this).addClass('hover'); 
 },function(){ 
  $(this).removeClass('hover'); 
 }).bind('click',function(){ 
  $(this).find("span").remove(); 
  input.val(this.innerHTML); 
  suggestWrap.hide(); 
 }); 
 } 
 init(); 
}; 
//实例化输入提示的JS,参数为进行查询操作时要调用的函数名 
var searchSuggest = new oSearchSuggest(sendKeyWordToBack); 
//这是一个模似函数，实现向后台发送ajax查询请求，并返回一个查询结果数据，传递给前台的JS,再由前台JS来展示数据。本函数由程序员进行修改实现查询的请求 
//参数为一个字符串，是搜索输入框中当前的内容 
function sendKeyWordToBack(keyword){ 
	$.ajax({
		type : "get",
		url: "http://www.zfshlm.com/155e7ac5857fb33bb5d9430ef3be1699/thinkphp32_zfshlm/Home/Index/ajaxShowStore?keyword="+keyword,
		dataType: "json",
		success:function(data){
			 var aData = []; 
			$.each(data, function(index, val) {
				//alert(val.id);
				aData.push(val.store_name);
				});
			
		
			 //将返回的数据传递给实现搜索输入框的输入提示js类 
			 searchSuggest.dataDisplay(aData); 
		}
	});
 //将返回的数据传递给实现搜索输入框的输入提示js类 
 searchSuggest.dataDisplay(aData); 
} 
</script>

</body>
</html>
